package ClassExercise1;

import java.io.*;

public class Exercise6 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Person s1 = new Person("陈俊华",18,true);
        ObjectOutputStream  s = new ObjectOutputStream(new FileOutputStream
                ("C:\\Users\\Administrator\\Desktop\\6.txt"));

        s.writeObject(s1);
        s.close();
        ObjectInputStream s2 = new ObjectInputStream(new FileInputStream("C:\\Users\\Administrator\\Desktop\\6.txt"));
        System.out.println(s2.readObject().toString());
        s2.close();
    }


}
